package com.lmf.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@Controller
public class MyController {

    @RequestMapping("/comm2")
    public void dosome(HttpServletRequest request,HttpServletResponse response) throws IOException {
//        request.setCharacterEncoding("utf-8");
//        response.setContentType("text/html;charset=UTF-8");
        PrintWriter writer = response.getWriter();
        writer.println("你好");
    }
    @RequestMapping("/hello")
    public String dosome2(HttpServletRequest request,HttpServletResponse response) throws IOException {
        request.setAttribute("xc","你好，show页面");
        return "show";
    }

}
